#pragma once
#include <iostream>

#include "reflection.h"

//抽象产品类TV(电视机类) 
class TV{
public:
	virtual void play() = 0;
};


//具体产品类HaierTV(海尔电视机类)
class HaierTV : public TV{
public:
	void play(){
		std::cout << "海尔电视机播放中。。。" << std::endl;
	}
};

class HisenseTV : public TV{
public:
	void play(){
		std::cout << "海信电视机播放中。。。" << std::endl;
	}
}; 

//抽象工厂类TVFactory(电视机工厂类)
class TVFactory{
public:
	virtual TV* produceTV() = 0;
}; 

//具体工厂类HaierTVFactory(海尔电视机工厂类)
class HaierTVFactory : public TVFactory{
public:
	TV* produceTV(){
		cout << "海尔电视机工厂生产海尔电视机。" << endl;
		return new HaierTV();
	}
};
//*注册反射
REGISTER(HaierTVFactory);


//具体工厂类HisenseTVFactory(海信电视机工厂类) 
class HisenseTVFactory : public TVFactory{
public:
	TV* produceTV(){
		cout << "海信电视机工厂生产海信电视机。" << endl;
		return new HisenseTV();
	}
}; 
//*注册反射
REGISTER(HisenseTVFactory);